import request from '@/utils/request'

// 库存查询开始---------------------------
export function getGoodsStocks(params) {
  return request({
    url: '/store/goods_stock/',
    method: 'GET',
    params
  })
}

export function deleteGoodsStocks(data) {
  return request({
    url: '/store/goods_stock/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 库存查询结束--------------
// 库存调拨开始

export function getGoodsTransferMaxCode(params) {
  return request({
    url: '/base/goods_transfer_code/',
    method: 'GET',
    params
  })
}



export function getGoodsTransfers(params) {
  return request({
    url: '/store/goods_transfer/',
    method: 'GET',
    params
  })
}


export function addGoodsTransfer(data) {
  return request({
    url: '/store/goods_transfer/',
    method: 'POST',
    data
  })
}


export function updateGoodsTransfer(data) {
  return request({
    url: `/store/goods_transfer/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delGoodsTransfer(id) {
  return request({
    url: `/store/goods_transfer/${id}/`,
    method: 'DELETE',
  })
}

export function delGoodsTransfers(data) {
  return request({
    url: `/store/goods_transfer/batch_delete/`,
    method: 'DELETE',
    data
  })
}

export function delGoodsTransferDetails(data) {
  return request({
    url: `/store/goods_transfer_detail/batch_delete/`,
    method: 'DELETE',
    data
  })
}

// 库存调拨结束

export function exportStockGoods(params, onDownloadProgress){
  return request({
    url: '/store/stock_goods_export/',
    method: 'GET',
    params,
    responseType: 'blob',
    onDownloadProgress
  })
}